// https://www.lintcode.com/problem/delete-node-in-a-linked-list/description

/**
 * Definition of ListNode
 * class ListNode {
 * public:
 *     int val;
 *     ListNode *next;
 *     ListNode(int val) {
 *         this->val = val;
 *         this->next = NULL;
 *     }
 * }
 */


class Solution {
public:
    /*
     * @param node: the node in the list should be deletedt
     * @return: nothing
     */
    void deleteNode(ListNode * node) {
       ListNode * next = node->next;
       node->val = next->val;
       node->next = node->next->next;
    }
};